package com.demo.gulimall.product.controller;

import com.demo.gulimall.common.utils.R;
import com.demo.gulimall.product.entity.SkuInfo;
import com.demo.gulimall.product.service.SkuInfoService;
import com.demo.gulimall.product.vo.SkuItemVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author Chen Yuan
 * @create 2023-06-12  15:37
 */
@Slf4j
@RestController
@RequestMapping("/item")
public class ItemController {

	@Autowired
	private SkuInfoService skuInfoService;

	@GetMapping("/sku")
	public R getItemSkuInfo(@RequestParam("skuId") Long skuId){
		SkuItemVo skuItem = skuInfoService.getSkuItem(skuId);
		return R.ok(skuItem);
	}

}
